import 'package:flutter/material.dart';

class UnknownPage extends StatelessWidget {
  const UnknownPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("未知页面"),
        backgroundColor: Colors.red, // 使用红色背景以突出显示错误
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            const Text(
              "404 页面未找到",
              style: TextStyle(fontSize: 24, color: Colors.red),
            ),
            const SizedBox(height: 20),
            ElevatedButton(
              onPressed: () {
                // 返回首页或其他默认页面
                Navigator.popUntil(context, ModalRoute.withName('/'));
              },
              child: const Text("返回首页"),
            )
          ],
        ),
      ),
    );
  }
}